#ifndef INTERSECTIONITEM_H
#define INTERSECTIONITEM_H

#include <QGraphicsPathItem>
#include "streetmap.h"
#include "geometryutilities.h"

class IntersectionItem : public QGraphicsPathItem
{
public:
  IntersectionItem(QGraphicsItem* parent = 0);

  void addRoads(const StreetMap::RoadList& roads);
  void setIntersectionName(const QString& name);
  void setIntersectionCenter(const GeometryUtilities::Point& center);

private:
  void createIntersection();

  QString mName;
  QList<GeometryUtilities::LineSegment> mLines;
  QList<GeometryUtilities::Point> mPoints;
  GeometryUtilities::Point mCenter;
};

#endif
